<?php

/* @var $this \yii\web\View */
/* @var $content string */

use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use app\assets\AppAsset;
use yii\helpers\Url;

AppAsset::register($this);
?>

<?php $this->beginPage() ?>
    <!DOCTYPE html>
    <html lang="<?= Yii::$app->language ?>">
    <head>

        <style type="text/css">
            .centertext{
                text-align: center;
            }
            .menuitem{
                color: black;
                font-size: 16px;
            }
        </style>

        <meta charset="<?= Yii::$app->charset ?>">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <?= Html::csrfMetaTags() ?>
        <title>分销管理系统</title>
        <?php $this->head() ?>
    </head>

    <style type="text/css">
        .centertext{
            text-align: left;
        }
        .menuitem{
            color: #373737;
            font-size: 16px;
        }

    </style>

    <body>
    <?php $this->beginBody() ?>


    <?php
    NavBar::begin([
        'brandLabel' => '分销管理系统',
        'brandUrl' => Yii::$app->homeUrl,
        'options' => [
            'class' => 'navbar-inverse navbar-fixed-top',
        ],
    ]);

    $loginOutItem = [
        ['label' => '退出登录',
            'options'=>['id'=>'loginOut']],
    ];

    echo Nav::widget([
        'options' => ['class' => 'navbar-nav navbar-right'],
        'items' => $loginOutItem,
    ]);


    NavBar::end();
    ?>
    <div style="min-width: 1000px;width: 100%;height: 100%">


        <div style="float: left; width: 10%;height: 500px;padding-top: 80px;padding-left: 20px;">
            <div style="width: 170px;">
                <div class="panel-group" id="accordion2">

                    <!--            佣金查看 section1 menuitemid 11 -->
                    <div class="panel panel-default">
                        <div class="panel-heading" data-toggle="collapse"
                             data-parent="#accordion2" href="#collapseOne">
                            <p class="accordion-toggle menuitem">佣金查看</p>
                        </div>
                        <div id="collapseOne" class="<?php if($this->params['menuitemid'] < 20 ){echo 'panel-collapse in';}else{echo 'panel-collapse collapse';} ?>"
                             style="height: <?php if($this->params['menuitemid'] < 20 ){echo 'auto';}else{echo '0px';} ?>;">
                            <div class="panel-body centertext">
                                <ul class="nav nav-pills nav-stacked">
                                    <li class="<?php if($this->params['menuitemid'] == 11){echo 'active test';} ?>"><a href="<?php echo Url::toRoute('index.php/lowgrade/mybroke'); ?>">我的佣金</a></li>
                                    <li class="<?php if($this->params['menuitemid'] == 12){echo 'active test';} ?>"><a href="<?php echo Url::toRoute('index.php/lowgrade/mainview'); ?>">二级代理商佣金</a></li>
                                    <li class="<?php if($this->params['menuitemid'] == 13){echo 'active test';} ?>"><a href="<?php echo Url::toRoute('index.php/lowgrade/thirdagent'); ?>">三级代理商佣金</a></li>
                                </ul>
                            </div>
                        </div>
                    </div>
                    <!--            代理管理 section2 menuitemid 21-->
                    <div class="panel panel-default">
                        <div class="panel-heading" data-toggle="collapse"
                             data-parent="#accordion2" href="#collapseTwo">
                            <p class="accordion-toggle menuitem">代理管理</p>
                        </div>
                        <div id="collapseTwo" class="<?php if($this->params['menuitemid'] > 20 && $this->params['menuitemid'] < 30 ){echo 'panel-collapse in';}else{echo 'panel-collapse collapse';} ?>"
                             style="height: <?php if($this->params['menuitemid'] > 20 && $this->params['menuitemid'] < 30 ){echo 'auto';}else{echo '0px';} ?>;">
                            <div class="panel-body centertext">
                                <ul class="nav nav-pills nav-stacked">
                                    <li class="<?php if($this->params['menuitemid'] == 21){echo 'active';} ?>"><a href="<?php echo Url::toRoute('index.php/lowgrade/accept'); ?>">代理审批</a></li>
                                    <li class="<?php if($this->params['menuitemid'] == 22){echo 'active';} ?>"><a href="<?php echo Url::toRoute('index.php/lowgrade/deal'); ?>">代理管理</a></li>
                                </ul>
                            </div>
                        </div>
                    </div>
<!--                                推广管理 section3 menuitemid 31-->
                    <div class="panel panel-default">
                        <div class="panel-heading" data-toggle="collapse"
                             data-parent="#accordion2" href="#collapseThree">
                            <p class="accordion-toggle menuitem">推广管理</p>
                        </div>
                        <div id="collapseThree" class="<?php if($this->params['menuitemid'] > 30 && $this->params['menuitemid'] < 40 ){echo 'panel-collapse in';}else{echo 'panel-collapse collapse';} ?>"
                             style="height: <?php if($this->params['menuitemid'] > 30 && $this->params['menuitemid'] < 40 ){echo 'auto';}else{echo '0px';} ?>;">
                            <div class="panel-body centertext">
                                <ul class="nav nav-pills nav-stacked">
                                    <li class="<?php if($this->params['menuitemid'] == 31){echo 'active';} ?>"><a href="<?php echo Url::toRoute('index.php/lowgrade/shareurl'); ?>">分享推广</a></li>

                                </ul>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>

        <div style="float: left;width: 80%;margin-left: 100px;margin-top:80px">


            <?= $content ?>


        </div>


    </div>

    <script>
        $('body').on('click','#loginOut',function() {

            $('#loginOutModal').modal();

        });

    </script>

    <div class="modal fade" id="loginOutModal">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">确定退出登录</h4>
                </div>
                <div class="modal-body">
                    <p>退出登录后需要重新登录操作</p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <a type="button" class="btn btn-primary" href="../login/logout">确定</a>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->


    <?php $this->endBody() ?>
    </body>
    </html>
<?php $this->endPage() ?>